package org.nepu.srr.设备设施本体风险.功能试验.仪表通讯系统;

import lombok.Data;
import org.nepu.sc.domain.DataVO;
import org.nepu.sc.domain.CommonMethods;

@Data
public class B225InstrumentSystemParams {
    //司钻触摸显示屏（合格/不合格）
    DataVO test1;

    //通讯系统包含司钻房话站、二层台话站（合格/不合格）
    DataVO test2;

    //监视系统（合格/不合格）
    DataVO test3;
    public B225InstrumentSystemResult rate(){
        double fullScore = 25;
        double score = 0;
        if(test1.getData().equals("合格")){
            score += 5;
        }
        if(test2.getData().equals("合格")){
            score += 10;
        }
        if(test3.getData().equals("合格")){
            score += 10;
        }
        double rate = score/fullScore;
        B225InstrumentSystemResult result = new B225InstrumentSystemResult();
        result.setRateScore(rate);
        String s = CommonMethods.toGrade(rate);
        result.setRateResult(s);
        return result;
    }
}
